package com.originskyseed.platform.cms.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.cms.model.CmsType;

/**
 * 新闻类型表Mapper类（OSI_CMS_TYPE）
 *
 * @author wlj
 */
public interface CmsTypeMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(CmsType record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(CmsType record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(CmsType record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(CmsType record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public CmsType selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询名称是否存在
	 *
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public CmsType selectIsNullByTypeName(String name) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<CmsType> selectList(CmsType record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsType> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsType> selectListByPlatform(Map<String, Object> params) throws Exception;

	/**
	 * 更新是否置顶
	 *
	 * @param cmsType
	 * @return
	 * @throws Exception
	 */
	public int updateIsTop(CmsType cmsType) throws Exception;

	/**
	 * 根据优先级查询新闻
	 *
	 * @return
	 * @throws Exception
	 */
	public CmsType selectCmsTypeByPrority(@Param("prority") Integer prority) throws Exception;

	/**
	 * 查询最大优先级
	 *
	 * @return
	 * @throws Exception
	 */
	public Integer selectMaxPrority() throws Exception;

}
